home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / sources / gdevicetest.cp < prev    next >
Encoding:
Text File  |  2000-09-28  |  1.9 KB  |  66 lines

  1. /*
  2.     File:        GDeviceTest.cp
  3.  
  4.     Contains:    TGDevice is a GDevice utility class, finding out GDevice information.
  5.                   GDeviceTest.cp contains the class testing functions.
  6.  
  7.     Written by: Kent Sandvik    
  8.  
  9.     Copyright:    Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24. #ifndef _GDEVICE_
  25. #include "GDevice.h"
  26. #endif
  27.  
  28. // This test will scan through all the GDevices on the system, and print
  29. // out the base address, row, and the depth size.
  30.  
  31. void main(void)
  32. {
  33.     Ptr aBase;
  34.     long aRow;
  35.     short aDepth;
  36.  
  37.     cout << "TGDevice test \n";
  38.  
  39.     // Iterate through all the screens connected to the system.
  40.     for (TGDevice myScreens; !myScreens.Last(); myScreens.Next())
  41.     {
  42.         aBase = myScreens.GetBase();
  43.         aRow = myScreens.GetRow();
  44.         aDepth = myScreens.GetDepth();
  45.  
  46.         printf("Base address = %X\n", aBase);
  47.         fflush(stdout);                            // cout was broken (MPW) concerning %X
  48.         cout << "Row = " << aRow;
  49.         cout << "\n";
  50.         cout << "Depth = " << aDepth;
  51.         cout << "\n";
  52.     }
  53. }
  54.  
  55. // _________________________________________________________________________________________________________ //
  56.  
  57.  
  58. /*    Change History (most recent last):
  59.   No        Init.    Date        Comment
  60.   1            khs        6/2/92        New file
  61.   2            khs        7/5/92        First decent release
  62.   3            khs        9/7/92        Changed the structure of the classes
  63. */
  64.  
  65.  
  66.